package day05;

import javafx.scene.transform.Scale;

import java.util.Scanner;

/**
 * @author Huangjin
 * @version 1.0
 * describe: 随机加法运算器
 * @date 2023/2/16 9:34
 */
public class Addition {
    private static final int TEN = 10;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int score = 0;
        for (int i = 1; i <= TEN; i++) {
            int a = (int)(Math.random()*100+1);
            int b = (int)(Math.random()*100+1);
            System.out.println("("+i+")"+a+" + "+b+" = ?");
            System.out.println("请开始答题：");
            int c = sc.nextInt();
            if (c==a+b){
                System.out.println("答对了");
                score+=10;
            }else {
                System.out.println("答错了");
            }
        }
        System.out.println("你的答题总分为："+score+"分");
    }
}
